package jasonllinux.app.life;

import jasonllinux.app.life.Activity01.MyButtonListener;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Activity02 extends Activity{
	
	private Button myButton;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		System.out.println("Acitvity02------------->onCreate");
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity02);
		
		myButton = (Button) findViewById(R.id.myButton2);
        myButton.setOnClickListener(new MyButtonListener());
	}

    
    class MyButtonListener implements OnClickListener {

		@Override
		public void onClick(View v) {
			Intent intent = new Intent();
			intent.setClass(Activity02.this, Activity03.class);
			Activity02.this.startActivity(intent);
			//onDestroy
			finish();
		}
    	
    }
	@Override
	protected void onDestroy() {
    	System.out.println("Acitvity02------------->onDestroy");
		super.onDestroy();
	}

	@Override
	protected void onPause() {
		System.out.println("Acitvity02------------->onPause");
		super.onPause();
	}

	@Override
	protected void onRestart() {
		System.out.println("Acitvity02------------->onRestart");
		super.onRestart();
	}

	@Override
	protected void onResume() {
		System.out.println("Acitvity02------------->onResume");
		super.onResume();
	}

	@Override
	protected void onStart() {
		System.out.println("Acitvity02------------->onStart");
		super.onStart();
	}

	@Override
	protected void onStop() {
		System.out.println("Acitvity02------------->onStop");
		super.onStop();
	}
	
	

}
